import { View } from "../../../mvc/core/View";
import { ObjCreate } from "../common/ObjCreate";
import { GTextFormat } from "../../../common/GTextFormat";
import { Cache } from "../../cache/Cache";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { SExpDice } from "../../../../Message/Public/SExpDice";
type int = number;
//class ResulteItem
    
    export  class ResulteItem extends View
    {
        constructor()
        {
            super();
            this.initView();
            return;
        }

        /* internal  */initView(): void
        {
            ObjCreate.createBg(0, 0, 374, 32, this);
            this._titleTx = ObjCreate.createTextField("", 12, 5, 102, 23, this, new GTextFormat(null, 14, null, null, null, null, null, null, flash.text.TextFormatAlign.CENTER));
            this._rewardTx = ObjCreate.createTextField("", 140, 6, 238, 22, this, new GTextFormat(null, 14, null, null, null, null, null, null, flash.text.TextFormatAlign.LEFT));
            return;
        }

        public upDate(arg1: int): void
        {
            this._sexpDice = Cache.instance.playDice.sExpDice;
            if (arg1 != 0) 
            {
                if (arg1 > 0) 
                {
                    if (!(Cache.instance.playDice.titleInChange() == "") && !(Cache.instance.playDice.getExpString() === "")) 
                    {
                        this._titleTx.htmlText = HTMLUtil.addColor("【" + Cache.instance.playDice.titleInChange() + "】", "#ff00ff");
                        this._rewardTx.htmlText = HTMLUtil.addColor(Cache.instance.playDice.getExpString(), GlobalStyle.color5);
                    }
                }
                else if (!(Cache.instance.playDice.titleInChange() == "") && !(Cache.instance.playDice.getExpString() === "")) 
                {
                    this._titleTx.htmlText = HTMLUtil.addColor("【" + Cache.instance.playDice.titleInChange() + "】", "#ff00ff");
                    this._rewardTx.htmlText = HTMLUtil.addColor(Cache.instance.playDice.getExpString(), GlobalStyle.color5);
                }
            }
            else if (!(Cache.instance.playDice.isRewardEx() == "") && !(Cache.instance.playDice.getExpString() === "")) 
            {
                this._titleTx.htmlText = HTMLUtil.addColor("【" + Cache.instance.playDice.isRewardEx() + "】", "#ff00ff");
                this._rewardTx.htmlText = HTMLUtil.addColor(Cache.instance.playDice.getExpString(), GlobalStyle.color5);
            }
            return;
        }

        /* internal */ /* var */_sexpDice: SExpDice;

        /* internal */ /* var */_titleTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_rewardTx: Object /* flash.text.TextField */;
    }
